<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<div id="imagefileQueue" style="position:absolute; top:400px; right:0px;">
</div>
<div class="p_img">
	<div class="action_bar">
		<div class="cnt">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
						<td style="padding:0;width:100px;" id="addImagesBtn" quickTip="<fmt:message key="productForm.addImagesBtn.tip" />">
							<input type="hidden" id="productImageUpload" name="productImageUpload"	value="" class="upload_img_1"/>
						</td>
						<td style="text-align:right;"><fmt:message key="product.imageUrl.title"/>:<fmt:message key="product.imageUrl.tip"/></td>
						<td style="text-align:right;">
							<a href="javascript:void(0)" onclick="removeAllProductImage();return false" class="empty">
								<i></i><fmt:message key = "button.clear"/>
							</a>
						</td>
				</tr>
		</table>
		</div>
	</div>
	<div class="main_pic">
		<div class="cnt">
			<div class="pic_area">
				<product:productImage id="productMainImageDiv" product="${product}" sizeType="m0" linkType="2" width="270" height="270"/>	
			</div>
		</div>
	</div>
	<div class="all_pics" id="allPicsDiv" style="display:none;">
		<div class="cnt">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr id="imageList">
				</tr>
			</table>
		</div>				
	</div>
</div>
<%-- 
<probiz:plugin_upload fileInputId="productImageUpload" uploadFileTypes="jpg"	uploadCategory="product" onComplete="uploadProductImagehandler" cssClass="upload_img_1"/>
--%>
<probiz:plugin_newUpload fileInputId="productImageUpload" fileQueueId="imagefileQueue" fileDesc="JPG files" fileExt="*.jpg;*.JPG"	uploadCategory="product"  multi="true"  onComplete="uploadProductImagehandler"/>


<script type="text/javascript">
$j(document).ready(function () {
	<%--start:初始化媒体--%>
	
	<c:forEach items="${product.productMedias}" var="media">
		<c:if test="${media.mediaType == 0}">
			addNewProductImage({mediaId:${media.productMediaId},mediaUrl:'${media.mediaUrl}',mediaDescription:'${media.mediaDescription}'},${media.mediaType},false);
		</c:if>
		<c:if test="${media.mediaType == 1}">
			addNewProductAccessory({mediaId:${media.productMediaId},mediaUrl:'${media.mediaUrl}',mediaDescription:'${media.mediaDescription}'},${media.mediaType},false);
		</c:if>
		
	</c:forEach>
	showImageMoveIcons();
	showAccessoryMoveIcons();
	<%--end:初始化媒体--%>
	
	//start:quickTip 生成 原因：在tag中$j无法扑捉到对象;另外直接用id指定是为了提高在ie下的查找速度
	$j('#addImagesBtn').each(function(){
      	$j(this).after('<img id="'+this.id+'_tip" width="14" height="14" src="'+__ctxPath+'/images/validate/info.gif"/>');
		$j('#'+this.id+'_tip').PQuickTip({
	         source:'text',
	         title:'Help',
	         type:'help',
	         text:$j(this).attr("quickTip")
      	});
	
	});
	//end:quickTip 生成
});	
</script>	
